
%%%-------------------------------------------------------------------
%%% File:      erlymate_shell.erl
%%% @author    Roberto Saccon <rsaccon@gmail.com> [http://rsaccon.com]
%%% @copyright 2007 Roberto Saccon
%%% @doc  
%%%
%%% @end  
%%%
%%% The MIT License
%%%
%%% Copyright (c) 2007 Roberto Saccon
%%%
%%% Permission is hereby granted, free of charge, to any person obtaining a copy
%%% of this software and associated documentation files (the "Software"), to deal
%%% in the Software without restriction, including without limitation the rights
%%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
%%% copies of the Software, and to permit persons to whom the Software is
%%% furnished to do so, subject to the following conditions:
%%%
%%% The above copyright notice and this permission notice shall be included in
%%% all copies or substantial portions of the Software.
%%%
%%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
%%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
%%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
%%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
%%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
%%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
%%% THE SOFTWARE.
%%%
%%% @since 2007-12-22 by Roberto Saccon
%%%-------------------------------------------------------------------
-module(erlymate_shell).
-author('rsaccon@gmail.com').

%% API
-export([ok/0, run/7]).

%%====================================================================
%% API
%%====================================================================
%%--------------------------------------------------------------------
%% @spec () -> ok.
%% @doc
%% used to check availability and status of this module 
%% @end 
%%--------------------------------------------------------------------
ok() -> ok.


%%--------------------------------------------------------------------
%% @spec  (socket(), string(), string(), string(), string()) -> {exit, integer()}
%% @doc
%% main function to execute compilation
%% @end 
%%--------------------------------------------------------------------
run(Socket, _, _File, Line, Word, LineIndex, _LineNumber) ->
    io:format("TRACE ~p:~p ~p~n",[?MODULE, ?LINE, gotit]),
    erlymate:fwrite(Socket, "\n~s\n> ", ["hi"]).




    %% {scopeName = 'source.erl-shell';
    %%  fileTypes = ( );
    %%  patterns = (
    %%      {   name = 'source.erlang.erl-shell';
    %%          begin = '^[>+:]';
    %%          end = '\n\z';
    %%          beginCaptures = { 0 = { name = 'keyword.section.erl-shell'; }; };
    %%          patterns = ( { include = 'source.erlang'; } );
    %%      },
    %%      {   name = 'source.erlang.erl-shell';
    %%          begin = '^Browse\[\d+\]';
    %%          end = '\n\z';
    %%          beginCaptures = { 0 = { name = 'comment.section.erl-shell'; }; };
    %%          patterns = ( { include = 'source.erlang'; } );
    %%      },
    %%  );
    %% }
    
    %% OUTPUT=`$ERLYMATE shell`
    %% 
    %% if [ "$OUTPUT" = "" ]; then
    %%    echo -en "\n> "
    %%    exit_insert_text
    %% else 
    %%    exit_insert_text "$OUTPUT"
    %% fi
    